package com.itheima.poi;

import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.junit.Test;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class POIDemo {

    /*@Test
    public void test01() throws Exception {
        //加载POI配置文件
        XSSFWorkbook excel = new XSSFWorkbook(new FileInputStream( new File("D:\\POI测试无用的.xlsx")));
        //读取Excel文件第一个Sheet标签页
        XSSFSheet sheet = excel.getSheetAt(0);
        //遍历Sheet标签页,获取每一行
        for (Row row : sheet) {
            //遍历获取每个单元格对象
            for (Cell cell : row) {
                String stringCellValue = cell.getStringCellValue();
                System.out.print(stringCellValue + "  ");
            }
        }
        excel.close();

    }

    //写出数据
    @Test
    public void test02(){
        //在内存中创建一个excel
        XSSFWorkbook myWorkbook = new XSSFWorkbook();
        //创建文件名成
        XSSFSheet rows = myWorkbook.createSheet("98期花名册");

    }*/

}
